﻿using GM_Shop.Model.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace GM_Shop.Model
{
    public static class TypeOfExpand
    {
        public static string GetTableName<T>(this Type type)
        {
            if (type.IsDefined(typeof(TableNameAttribute), true))
            {
                return type.GetCustomAttribute<TableNameAttribute>().GetName();
            }
            return type.Name;
        }
    }
}
